<template>
  <div>
    <div class="box">
      <p class="p_1">确认订单</p>
      <p class="p_2">￥66</p>
      <ul>
        <li>
          <div class="left">车费</div>
          <div class="right">￥{{mny}}</div>
        </li>
        <li>
          <div class="left">单号</div>
          <div class="right">{{ Time() }}</div>
        </li>
        <li style="border: none; margin-top: 60px; color: red">
          <span class="ca">客户支付成功,确认无误返回首页</span>
        </li>
      </ul>
      <p>
        <button class="btn" @click="btn">返回首页</button>
      </p>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      mny: 100
    };
  },
  methods: {
    Time() {
      let date = new Date();
      let year = date.getFullYear(); // 年
      let month = date.getMonth() + 1; // 月
      let day = date.getDate(); // 日
      let week = date.getDay(); // 星期
      let weekArr = [
        "星期日",
        "星期一",
        "星期二",
        "星期三",
        "星期四",
        "星期五",
        "星期六"
      ];
      let hour = date.getHours(); // 时
      hour = hour < 10 ? "0" + hour : hour; // 如果只有一位，则前面补零
      let minute = date.getMinutes(); // 分
      minute = minute < 10 ? "0" + minute : minute; // 如果只有一位，则前面补零
      let second = date.getSeconds(); // 秒
      second = second < 10 ? "0" + second : second; // 如果只有一位，则前面补零
      return `${year}${month}${day}${hour}${minute}${second}`;
    },
    btn() {
      // 确认订单返回首页
      this.$router.push("/home");
    }
  }
};
</script>

<style lang="scss" scoped>
.ca {
  display: block;
  width: 270px;
  height: 44px;
  text-align: center;
  line-height: 44px;
}
.box {
  width: 80%;
  height: 100vh;
  margin: 0 auto;
  p {
    margin-top: 35px;
  }
}
.p_1 {
  width: 100%;
  height: 40px;
  line-height: 40px;
  color: black;
  text-align: center;
  font-size: 25px;
  font-weight: 500;
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}
.p_2 {
  width: 100%;
  height: 10px;
  line-height: 10px;
  text-align: center;
  font-size: 20px;
}
ul {
  overflow: hidden;
}
ul li {
  list-style: none;
  overflow: hidden;
  width: 90%;
  border-bottom: 1px solid plum;
  margin: 0 auto;
  height: 43px;
}
ul li .left {
  display: inline-block;
  float: left;
  height: 43px;
  line-height: 43px;
}
ul li .right {
  display: inline-block;
  float: right;
  height: 43px;
  line-height: 43px;
}
.box p .btn {
  width: 100%;
  background: orange;
  border: none;
  height: 50px;
  margin-top: 15px;
  border-radius: 10px;
  text-align: center;
  line-height: 50px;
}
</style>